home *** CD-ROM | disk | FTP | other *** search
/ Space & Astronomy / Space and Astronomy (October 1993).iso / pc / programs / mac / almanac.sit / Almanac v1.8 / card_7837.txt < prev    next >
Text File  |  1990-04-21  |  8KB  |  309 lines

  1. -- card: 7837 from stack: in.8
  2. -- bmap block id: 8910
  3. -- flags: 0000
  4. -- background id: 2765
  5. -- name: Moon
  6. ----- HyperTalk script -----
  7. on fetchOcc he
  8.   global oldit,she,today,total,force
  9.   -- Hard Disk:Astronomy:Oc-1990
  10.   if not total then exit fetchOcc
  11.   put false into npath
  12.   get the script of cd "Moon"
  13.   put line 3 of it into path
  14.   repeat until number of chars of line 3 of it > 6 and the commandKey is up
  15.     put "Select file for Lunar Occultation Predictions..."
  16.     put filename("TEXT") into path
  17.     if path is empty then exit repeat
  18.     put "  -- "&path into line 3 of it
  19.     set script of cd "Moon" to it
  20.     put true into npath
  21.   end repeat
  22.   hide message box
  23.   put empty into oldit
  24.   put 2 into las
  25.   put false into done
  26.   if he is empty then exit fetchOcc
  27.   put word 1 of he && word 2 of he into she
  28.   get char 2 of word 2 of last line of cd fld totalOcc
  29.   if it is "/" then subtract 1 from las
  30.   put word 1 of last line of cd fld totalOcc && char 1 to las of word 2 of last line of cd fld totalOcc into today
  31.   if not((today is in she) and (she is in today)) or npath or force then
  32.     -- import text
  33.     if number of chars of he=5 then put space after char 3 of he
  34.     if the shiftKey is up and number of lines of cd fld totalOcc Γëá 0 then
  35.       select text of cd fld totalOcc
  36.       doMenu "Clear Text"
  37.     end if
  38.     if "--" is in path then delete char 1 to 5 of path
  39.     open file path
  40.     put the ticks into t0
  41.     repeat
  42.       set cursor to busy
  43.       read from file path until "&"
  44.       if it is empty then
  45.         exit repeat
  46.       end if
  47.       delete last char of it
  48.       if it contains he then
  49.         exit repeat
  50.       else
  51.         --    put he && char 6 to 7 of line 3 of it
  52.         if first word of he is in it and second word of he< char 6 to 7 of line 3 of it then
  53.           put true into done
  54.           exit repeat
  55.         end if
  56.       end if
  57.       put it into oldit
  58.     end repeat
  59.     if done then
  60.       close file path
  61.       put "           No totals for this date." into line 4 of cd fld totalOcc
  62.       exit fetchOcc
  63.     end if
  64.     close file path
  65.     put the ticks into t1
  66.     put number of lines of oldit into nlines
  67.     put 0 into prevday
  68.     if getday(it)-getday(oldit)=1 then
  69.       repeat with i=3 to nlines
  70.         if char 9 to 10 of line i of oldit >=20 then
  71.           put i into oldi
  72.           repeat with i=oldi to nlines
  73.             put "*" into char 1 of line i of oldit
  74.           end repeat
  75.           put return & line oldi to nlines of oldit after line 2 of it
  76.           exit repeat
  77.         end if
  78.       end repeat
  79.     end if
  80.     if hilite of button "Filter  >=" then
  81.       put the number of lines of it into num
  82.       if num=0 then exit fetchOcc
  83.       put line 1 to 2 of it & return into cd fld totalOcc
  84.       repeat with i=3 to num
  85.         if (char 16 of line i of it)>=char 1 of cd fld Filter then
  86.           put line i of it & return after cd fld totalOcc
  87.         end if
  88.       end repeat
  89.       put 1 into j
  90.     else
  91.       put it after cd fld totalOcc
  92.       put -1 into j
  93.     end if
  94.     get the number of lines of cd fld totalOcc
  95.     if it > 0 then put "   (" & it-3+j && "totals)" after line 1 of cd fld totalOcc
  96.     put " "& rnd10((t1-t0)/60) &" s." after line 1 of cd fld totalOcc
  97.     find "STAR"
  98.     repeat until ": " is not in cd fld totalOcc
  99.       find string ": "
  100.       put "put ""e&":0""e&&"into" && the foundChunk into command
  101.       do command
  102.     end repeat
  103.   end if
  104.   ftype "totalOcc",7
  105. end fetchOcc
  106.  
  107. function getday arg
  108. get char 6 to 7 of line 3 of arg
  109. return it
  110. end getday
  111.  
  112. on openCard
  113.   global total
  114.   if total then set textFont of cd fld totalOcc to Courier
  115.   pass openCard
  116. end openCard
  117.  
  118.  
  119.  
  120. -- part 9 (button)
  121. -- low flags: 00
  122. -- high flags: A003
  123. -- rect: left=92 top=313 right=334 bottom=173
  124. -- title width / last selected line: 0
  125. -- icon id / first selected line: 0 / 0
  126. -- text alignment: 1
  127. -- font id: 0
  128. -- text size: 12
  129. -- style flags: 0
  130. -- line height: 16
  131. -- part name: Tomorrow
  132. ----- HyperTalk script -----
  133. on mouseUp
  134.   global doo
  135.   put 1 into doo
  136.   put char 1 to 3 of second word of nDate(1,12,1) && first word of nDate(1,12,1) into he
  137.   fetchOcc he
  138.   put 0 into doo
  139. end mouseUp
  140.  
  141.  
  142.  
  143.  
  144. -- part 14 (field)
  145. -- low flags: 00
  146. -- high flags: 0002
  147. -- rect: left=38 top=171 right=285 bottom=396
  148. -- title width / last selected line: 0
  149. -- icon id / first selected line: 0 / 0
  150. -- text alignment: 0
  151. -- font id: 15036
  152. -- text size: 12
  153. -- style flags: 0
  154. -- line height: 16
  155. -- part name: TotalOcc
  156.  
  157.  
  158. -- part 15 (button)
  159. -- low flags: 00
  160. -- high flags: 8003
  161. -- rect: left=6 top=313 right=334 bottom=87
  162. -- title width / last selected line: 0
  163. -- icon id / first selected line: 0 / 0
  164. -- text alignment: 1
  165. -- font id: 0
  166. -- text size: 12
  167. -- style flags: 0
  168. -- line height: 16
  169. -- part name: Today
  170. ----- HyperTalk script -----
  171. on mouseUp
  172.   put char 1 to 3 of second word of nDate(1,12,0) && first word of nDate(1,12,0) into he
  173.   fetchOcc he
  174. end mouseUp
  175.  
  176.  
  177.  
  178. -- part 16 (button)
  179. -- low flags: 00
  180. -- high flags: 8003
  181. -- rect: left=290 top=313 right=334 bottom=371
  182. -- title width / last selected line: 0
  183. -- icon id / first selected line: 0 / 0
  184. -- text alignment: 1
  185. -- font id: 0
  186. -- text size: 12
  187. -- style flags: 0
  188. -- line height: 16
  189. -- part name: Other Days
  190. ----- HyperTalk script -----
  191. on mouseUp
  192.   Ask "Enter date (mon dd):"
  193.   put it into he
  194.   fetchOcc he
  195. end mouseUp
  196.  
  197.  
  198.  
  199. -- part 17 (button)
  200. -- low flags: 00
  201. -- high flags: C006
  202. -- rect: left=42 top=114 right=133 bottom=119
  203. -- title width / last selected line: 0
  204. -- icon id / first selected line: 0 / 0
  205. -- text alignment: 1
  206. -- font id: 0
  207. -- text size: 12
  208. -- style flags: 0
  209. -- line height: 16
  210. -- part name: Filter  >=
  211. ----- HyperTalk script -----
  212. on mouseUp
  213.   global doo,dodoo
  214.   set hilite of me to not hilite of me
  215.   put 1 into dodoo
  216.   send mouseUp to btn today
  217.   put 0 into dodoo
  218. end mouseUp
  219.  
  220.  
  221.  
  222. -- part 18 (field)
  223. -- low flags: 00
  224. -- high flags: 0000
  225. -- rect: left=110 top=114 right=131 bottom=138
  226. -- title width / last selected line: 0
  227. -- icon id / first selected line: 0 / 0
  228. -- text alignment: 1
  229. -- font id: 0
  230. -- text size: 12
  231. -- style flags: 0
  232. -- line height: 16
  233. -- part name: Filter
  234.  
  235.  
  236. -- part 19 (button)
  237. -- low flags: 00
  238. -- high flags: 0004
  239. -- rect: left=179 top=304 right=342 bottom=224
  240. -- title width / last selected line: 0
  241. -- icon id / first selected line: 15844 / 15844
  242. -- text alignment: 1
  243. -- font id: 0
  244. -- text size: 12
  245. -- style flags: 0
  246. -- line height: 16
  247. -- part name: Print
  248. ----- HyperTalk script -----
  249. on mouseUp
  250.   printField cd fld 1,"Courier"
  251. end mouseUp
  252.  
  253.  
  254.  
  255. -- part contents for background part 7
  256. ----- text -----
  257. Sidereal Time = 5:19
  258. 5.321728
  259.  
  260. -- part contents for background part 6
  261. ----- text -----
  262. Universal Time = 20:55
  263. 20.933333
  264. 7:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0
  265.  
  266. -- part contents for background part 31
  267. ----- text -----
  268. Julian Date = 2448003.372
  269.  
  270. -- part contents for background part 14
  271. ----- text -----
  272. Occult.
  273.  
  274. -- part contents for background part 28
  275. ----- text -----
  276. 22 April 1990 (JT)
  277.  
  278. -- part contents for background part 39
  279. ----- text -----
  280.  99%-
  281.  
  282. -- part contents for card part 18
  283. ----- text -----
  284. 3
  285.  
  286. -- part contents for background part 13
  287. ----- text -----
  288. Moon Rises at 4:30 AM
  289. Moon Sets  at 4:30 PM
  290. 58.232809
  291. 4.5125367
  292. 16.5044251
  293. 4/21/90
  294.  
  295. -- part contents for background part 10
  296. ----- text -----
  297. Moon R.A. = 23h 02m
  298. Moon Dec.  = -3┬░ 05'
  299. below W horizon
  300.  
  301. 345.7333937
  302. -3.0910991
  303.  
  304. -- part contents for card part 14
  305. ----- text -----
  306. RATING FOR APR 22 =  .09   (1 totals) 4 s.
  307.  DATE   T(UT) PR STAR #  MAG  PCT MN  SN  CA
  308.  APR 22/10:16 R3 X31710  8.8  11- 14  -9  36S
  309.